﻿using UnityEngine;
using UnityEngine.UI;

namespace CGF
{
    public class ColliderBase : MonoBehaviour
    {
        public float scale { get { return transform.lossyScale.x / canvasScale; } }

        private float canvasScale = 1f;

        protected virtual void Awake()
        {
            if (transform is RectTransform)
            {
                CanvasScaler canvasScaler = transform.GetComponentInParent<CanvasScaler>();
                canvasScale = canvasScaler.transform.localScale.x;
            }
        }

        public virtual void Init() { }

        public virtual void RefreshLastPos() { }

        public virtual void DrawGizmos() { }
    }
}